﻿using SD.Infrastructure.RepositoryBase;
using SlamDunk.MES.Domain.Entities.FoundationContext;
using System;
using System.Collections.Generic;

namespace SlamDunk.MES.Domain.IRepositories.Interfaces.FoundationContext
{
    /// <summary>
    /// 计量单位仓储接口
    /// </summary>
    public interface IMeasureUnitRepository : IEntityRepository<MeasureUnit>
    {
        #region # 分页获取计量单位列表 —— ICollection<MeasureUnit> FindByPage(string keywords...
        /// <summary>
        /// 分页获取计量单位列表
        /// </summary>
        /// <param name="keywords">关键字</param>
        /// <param name="unitGroupId">计量单位组Id</param>
        /// <param name="isMaster">是否主计量单位</param>
        /// <param name="pageIndex">页码</param>
        /// <param name="pageSize">页容量</param>
        /// <param name="rowCount">总记录数</param>
        /// <param name="pageCount">总页数</param>
        /// <returns>计量单位列表</returns>
        ICollection<MeasureUnit> FindByPage(string keywords, Guid? unitGroupId, bool? isMaster, int pageIndex, int pageSize, out int rowCount, out int pageCount);
        #endregion

        #region # 获取计量单位列表 —— ICollection<MeasureUnit> FindByGroup(Guid groupId)
        /// <summary>
        /// 获取计量单位列表
        /// </summary>
        /// <param name="groupId">计量单位组Id</param>
        /// <returns>计量单位列表</returns>
        ICollection<MeasureUnit> FindByGroup(Guid groupId);
        #endregion

        #region # 获取计量单位字典 —— IDictionary<string, MeasureUnit> Find(IEnumerable<string>...
        /// <summary>
        /// 获取计量单位字典
        /// </summary>
        /// <param name="unitNos">计量单位编号集</param>
        /// <returns>计量单位字典</returns>
        IDictionary<string, MeasureUnit> Find(IEnumerable<string> unitNos);
        #endregion

        #region # 是否存在计量单位 —— bool Exist(Guid? measureUnitId, string measureUnitNo)
        /// <summary>
        /// 是否存在计量单位
        /// </summary>
        /// <param name="measureUnitId">计量单位Id</param>
        /// <param name="measureUnitNo">计量单位编号</param>
        /// <returns>是否存在</returns>
        bool Exist(Guid? measureUnitId, string measureUnitNo);
        #endregion
    }
}
